package com.cwx.interfaces;

import com.cwx.utils.HttpUtils;

import java.io.IOException;
import java.net.URLEncoder;

/**
 * Created by code on 17-8-29.
 */
public class SMSInterface {

    public static final String KEY = "18fe9e0946e4517dcca673fd6c395f46";

    // 短信API服务
    public static String sms(String mobile,String tpl,String kv) throws IOException {
        StringBuffer url = new StringBuffer("http://v.juhe.cn/sms/send");
        url.append("?mobile=").append(mobile);
        url.append("&tpl_id=").append(tpl);
        url.append("&tpl_value=").append(URLEncoder.encode(kv,"UTF-8"));
        url.append("&key=").append(KEY);
        return HttpUtils.get(url.toString());
    }

}
